<?php
require 'dbcon.php';
$name=$_POST['name'];
$msg=$_POST['message'];
$date=$_POST['date'];
date_default_timezone_set("Asia/Shanghai");
$date=date("Y-m-d h:i:s");
$sql="insert into tb_note(w_name,message,w_date) values('$name','$msg','$date')";
$rs=$db->query($sql);
if ($rs==true) 
   {
        Header("Location:index.php");
    } else {
        echo "<script language='javascript' type='text/javascript'>";
        echo "alert('许愿失败！');";
        echo "</script>";
    }
    $db->close();